package cn.aj.system.service.impl;

import cn.aj.basic.service.impl.BaseServiceImpl;
import cn.aj.system.domain.Type;
import cn.aj.system.mapper.DetailMapper;
import cn.aj.system.mapper.TypeMapper;
import cn.aj.system.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TypeServiceImpl extends BaseServiceImpl<Type> implements TypeService {

    @Autowired
    private TypeMapper typeMapper;

    @Autowired
    private DetailMapper detailMapper;


    @Override
    @Transactional
    public void delete(Long id) {

        detailMapper.delete2(id);
        typeMapper.delete(id);

    }

    @Override
    public void batchDelete(List<Long> ids) {
        typeMapper.batchDelete(ids);
        detailMapper.batchDelete2(ids);
    }


}
